package org.example.im.common.serialize;

import lombok.Getter;

import java.util.*;

/**
 * @author dingrui
 * @since 2022/2/10
 * @description
 */
@Getter
public enum SerializerType {
    JSON((byte) 1);

    private final Byte code;

    SerializerType(Byte code) {
        this.code = code;
    }

    private static final Map<Byte, SerializerType> M = new HashMap<>();

    static {
        for (SerializerType e : SerializerType.values()) {
            M.put(e.getCode(), e);
        }
    }

    public static SerializerType getByCode(Byte code) {
        return M.get(code);
    }
}
